package com.ruoyi.factorydata.domain;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 采购单详情对象 purchase_order_detail
 *
 * @author ruoyi
 * @date 2025-07-17
 */
@Getter
@Setter
@TableName(resultMap = "com.ruoyi.factorydata.mapper.PurchaseOrderDetailMapper.PurchaseOrderDetailResult")
public class PurchaseOrderDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 详情ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 采购单ID
     */
    @Excel(name = "采购单ID")
    private Long purchaseOrderId;

    /**
     * 采购单名编号
     */
    @Excel(name = "采购单名编号")
    private String purchaseOrderCode;

    /**
     * 物料id
     */
    @Excel(name = "物料ID")
    private String materialId;
    /**
     * 物料编码
     */
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料图片
     */
    @Excel(name = "物料图片")
    private String materialImage;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称")
    private String materialName;

    /**
     * 物料规格
     */
    @Excel(name = "物料规格")
    private String materialSpecification;

    /**
     * 数量
     */
    @Excel(name = "数量")
    private BigDecimal quantity;

    /**
     * 单位
     */
    @Excel(name = "单位")
    private String unit;


    /**
     * 单价（元）
     */
    @Excel(name = "单价", readConverterExp = "元=")
    private BigDecimal unitPrice;

    /**
     * 小计（元）
     */
    @Excel(name = "小计", readConverterExp = "元=")
    private BigDecimal subtotal;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    /**
     * 物料单位名称
     */
    @Excel(name = "单位")
    @TableField(exist = false)
    private String materialUnitName;

}